
import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import fire from '@feidao/web/atom/browser/msg/fire';

export default async function ca012(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	//  详情
	const target_node = args[0].currentTarget;
	const id = target_node.getAttribute('data-feidao-id');
	const component_no = args[0].target.getAttribute('data-component');
	const event_no = args[0].target.getAttribute('data-event') || 'ec-001';
	const node = args[0].currentTarget.closest('[data-list]') as HTMLDivElement;
	if (node) {
		if (node.hasAttribute('data-value')) {
			const data = node.getAttribute('data-value');
			fire(component_no, event_no, id, data);
		} else {
			fire(component_no, event_no, id);
		}
	} else {
		fire(component_no, event_no, id);
	}
}
